import java.util.ArrayList;
import java.util.List;


public class Board {

	private List<BoardElement> universe;
	
	private int n;
	
	public Board(int n) {
		this.universe = new ArrayList<BoardElement>();
		this.n = n;
	}

	public int getNoOfCells() {
		return universe.size();
	}

	public void addCell(BoardElement boardElement) {
		universe.add(boardElement);
	}

	public Board generateNext() {
		Board nextBoard = new Board(n);
		for (BoardElement boardElement : this.universe) {
			nextBoard.addCell(boardElement.evolve());
		}
		return nextBoard;
	}

	
}
